From 9b29a7a7008f5607f92117a887d24d3bdafe92b3 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 10 Apr 2014 01:53:57 +0200 Subject: [PATCH] pixelcache: Add a warning for an invariant that shouldn't happen Pixel caches should be unmapped before being freed and unmapping clears those variables. --- gtk/gtkpixelcache.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gtk/gtkpixelcache.c b/gtk/gtkpixelcache.c index 339518bf8a..4ab8bb9549 100644 --- a/gtk/gtkpixelcache.c +++ b/gtk/gtkpixelcache.c @@ -69,6 +69,14 @@ _gtk_pixel_cache_free (GtkPixelCache *cache) if (cache == NULL) return; + if (cache->timeout_tag || + cache->surface || + cache->surface_dirty) + { + g_warning ("pixel cache freed that wasn't unmapped: tag %u surface %p sirty %p", + cache->timeout_tag, cache->surface, cache->surface_dirty); + } + if (cache->timeout_tag) g_source_remove (cache->timeout_tag); -- 2.30.2